namespace com.adjust.sdk.purchase
{
	public class ADJPUtils
	{
		public static string KeyMessage = "message";

		public static string KeyStatusCode = "statusCode";

		public static string KeyVerificationState = "verificationState";

		public static int ConvertLogLevel(ADJPLogLevel? logLevel)
		{
			if (!logLevel.HasValue)
			{
				return -1;
			}
			return (int)logLevel.Value;
		}

		public static string GetJsonString(JSONNode node, string key)
		{
			JSONNode jsonValue = GetJsonValue(node, key);
			if (jsonValue == null)
			{
				return null;
			}
			return jsonValue.Value;
		}

		public static JSONNode GetJsonValue(JSONNode node, string key)
		{
			if (node == null)
			{
				return null;
			}
			JSONNode jSONNode = node[key];
			if (jSONNode.GetType() == typeof(JSONLazyCreator))
			{
				return null;
			}
			return jSONNode;
		}

		public static ADJPVerificationState? StringToVerificationState(string verificationStateString)
		{
			if (verificationStateString.Equals("ADJPVerificationStatePassed"))
			{
				return ADJPVerificationState.ADJPVerificationStatePassed;
			}
			if (verificationStateString.Equals("ADJPVerificationStateFailed"))
			{
				return ADJPVerificationState.ADJPVerificationStateFailed;
			}
			if (verificationStateString.Equals("ADJPVerificationStateUnknown"))
			{
				return ADJPVerificationState.ADJPVerificationStateUnknown;
			}
			if (verificationStateString.Equals("ADJPVerificationStateNotVerified"))
			{
				return ADJPVerificationState.ADJPVerificationStateNotVerified;
			}
			return null;
		}
	}
}
